package com.maxd.modules.selfshop.merchants.respository;


import com.maxd.modules.selfshop.merchants.entity.SelfStoreComplain;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SelfStoreComplainJpaRepository extends JpaRepository<SelfStoreComplain, Long> {

    //条件查询带分页
    Page<SelfStoreComplain> findAll(Specification<SelfStoreComplain> specification, Pageable pageable);

    //条件查询
    List<SelfStoreComplain> findAll(Specification<SelfStoreComplain> specification);

    //根据商户id查询店铺
    @Query(value = "from SelfStoreComplain s where s.merchantId=:merchantId")
    SelfStoreComplain findByMerchantId(@Param("merchantId") Long merchantId);


}
